package com.example.attack.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.attack.mapper.ElCharacterMapper;
import com.example.attack.model.ElCharacter;
import com.example.attack.service.TransactionAService;
import com.example.attack.service.TransactionBService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class TransactionBServiceImpl extends ServiceImpl<ElCharacterMapper, ElCharacter> implements TransactionBService {

    @Transactional(propagation = Propagation.REQUIRES_NEW)
    public void createElCharacter(int i) {
        ElCharacter elCharacter = ElCharacter.builder().name("transactionBBBBBB").atk(new Double(i)).build();
        this.save(elCharacter);
    }

}
